package com.module.helper;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
 
public class AlertDialogHelper {
    /**
     * Function to display simple Alert Dialog
     * @param context - application context
     * @param title - alert dialog title
     * @param message - alert message
     * @param icon
     * 
     * reference : http://www.androidhive.info/2012/08/android-working-with-google-places-and-maps-tutorial/
     * */
    public static void showAlertDialog(Context context, String title, String message, Integer icon) {
        AlertDialog alertDialog = new AlertDialog.Builder(context).create();
 
        // Setting Dialog Title
        alertDialog.setTitle(title);
        
        // Setting Dialog Message
        alertDialog.setMessage(message);
 
        // Setting alert dialog icon
        if (icon != null){
        	alertDialog.setIcon(icon);
        }        
 
        // Setting OK Button
        alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
            }
        });
 
        // Showing Alert Message
        alertDialog.show();
    }
}
